<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .stars li{
      float: left;
      font-size: 50px;
      list-style-type: none;
      cursor: pointer;
    }
  </style>
  <script src="jquery-3.4.1.min.js"></script>
</head>
<body>
  <div class="stars">
    <ul>
      <li>☆</li>
      <li>☆</li>
      <li>☆</li>
      <li>☆</li>
      <li>☆</li>
    </ul>
  </div>
  <script>
    var stars = $(".stars li");
    stars.mouseover(function(){
      $(this).text("★").prevAll().html("★")  //当鼠标移入时给自己和前面的所有同胞改变text为★
    })
    stars.mouseout(function(){
      $(this).text("☆").prevAll().html("☆") //移出操作
    })
    
  </script>
</body>
</html>